<template>
  <el-dropdown @command="(cmd) => $emit('command', cmd)">
    <span>
      {{ title }}<i class="el-icon-arrow-down el-icon--right"></i>
    </span>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item
        v-for="(option, idx) in options"
        :key="idx"
        :command="option.command"
      >
        {{ option.label }}
      </el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</template>

<script>
export default {
  props: {
    title: String,
    options: Array,
  },
}
</script>
